package com.tiny_wind.tiny_wind_diary.model;


/**
 * 封装json对象，所有返回结果都使用它
 * 如果是数组放在List数组中.
 * 如果是字典放在Obj中.
 */
public class TwResultDataModel<T> {
	public T item;
	public T[] items;
	public TwPageModel page;

	TwResultDataModel(T item,TwPageModel page) {
		this.item = item;
		this.page = page;
	}

	/**
	 * 单页数据,自动填充page数据.;
	 * @param list
	 */
	TwResultDataModel(T[] list) {
		this.items = list;
		this.page = new TwPageModel(list.length);
	}

	/**
	 * 单条数据不显示page,itemCount;
	 * @param item
	 */
	public TwResultDataModel(T item) {
		this.item = item;
	}
}

